<!doctype html>
<html>
<head>
<script src="sockjs-1.1.2.js"></script>
<script src="lealone-5.0.0.js"></script>
<script src="generated/model/User.js"></script>
</head>
<body lang="en">
    <h1>Frontend crud test, see console log</h1>
    <script>

    var cb = function(message) {
        console.log(message);
    }
    User.dao.delete(cb);
    
    // insert
    new User().name.set("zhh").phone.set(123).insert(cb);
    // find one record
    User.dao.where().name.eq("zhh").findOne(cb);
    // update
    User.dao.notes.set("a notes").phone.set(123).where().name.eq("zhh").update(cb);
    // delete
    User.dao.where().name.eq("zhh").delete(cb);

    new User().name.set("u1").phone.set(123).insert(cb);
    new User().name.set("u2").phone.set(123).insert(cb);
    User.dao.findCount(cb);

    User.dao.where().name.like("u%").findList(cb);

    </script>
</body>
</html>
